<?php get_header(); ?>

<script type="text/javascript" language="javascript">

	$(document).ready(function(){
		if ($('#getguid').html() != ""){
			$('.menu').find('a').each(function(){
				if ($(this).attr('href') === $('#getguid').html()){
					$(this).addClass('selected');
					return false;
				}
			});
		}
	});

</script>

		<?php if (have_posts()) : ?>

 			<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
 			
 			
 			<div class="contentautoheight archive">
				<div class="titlepage">
					<p><span><?php /* If this is a category archive */ if (is_category()) { ?>
						Archive for '<?php single_cat_title(); ?>'
						<?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
						Posts Tagged '<?php single_tag_title(); ?>'
						<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
						Archive for <?php the_time('F jS, Y'); ?>
						<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
						Archive for <?php the_time('F, Y'); ?>
						<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
						Archive for <?php the_time('Y'); ?>
						<?php /* If this is an author archive */ } elseif (is_author()) { ?>
						Author Archive
						<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
						Blog Archives<?php } else the_title(); ?></span></p>
				</div>
				<div class="slideimg">
					<div class="autoheight" style="padding-bottom: 0px;">
					
						<div class="blog_container">
							<div class="blog_content">
								<div class="blog_title">
									<?php /* If this is a category archive */ if (is_category()) { ?>
									Archive for '<?php single_cat_title(); ?>'
									<?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
									Posts Tagged '<?php single_tag_title(); ?>'
									<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
									Archive for <?php the_time('F jS, Y'); ?>
									<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
									Archive for <?php the_time('F, Y'); ?>
									<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
									Archive for <?php the_time('Y'); ?>
									<?php /* If this is an author archive */ } elseif (is_author()) { ?>
									Author Archive
									<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
									Blog Archives<?php } else the_title(); ?>
								</div>

			<?php while (have_posts()) : the_post(); ?>
			
				<div <?php post_class() ?>>
				
					<h2 id="post-<?php the_ID(); ?>"><a style="font-family: Tahoma; font-size: 18px; line-height: 18px; color: #2C7FA2; font-weight: bold;" href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>

					<div class="entry" style="font-family: Tahoma; font-size: 13px; line-height: 18px; color: #7A7A7A;">
						<?php wpe_excerpt('wpe_excerptlength_archive', 'wpe_excerptmore'); ?>	
					</div>
					
					<div class="readmore"><a href="<?php the_permalink() ?>"><?php _e("Read More"); ?></a></div><br/>
					
					<?php get_template_part( 'meta' ); ?>

				</div>
				
				<div id="getguid" style="color:black; display:none;"><?php //print_r($post);
				
					$querystr = "
						SELECT post_id
						FROM $wpdb->postmeta
						WHERE meta_value = 'template-blog.php'
					";
					
					$pageposts = $wpdb->get_results($querystr, OBJECT);
					$post_id = $pageposts[0]->post_id;
					
					$querystr = "
						SELECT guid
						FROM $wpdb->posts
						WHERE ID = ".$post_id."
					";
					
					$pageposts = $wpdb->get_results($querystr, OBJECT);
					$guid = $pageposts[0]->guid;
					
					echo $guid; ?></div>

			<?php endwhile; ?>

			<?php get_template_part( 'nav' ); ?>
				

	<?php else : ?>

		<h2>Nothing found</h2>

	<?php endif; ?>
								
																
							</div>
							<div class="bgbottom"></div>
						</div>
						
						
						<!-- SIDEBAR -->
						<div class="blog_sidebar">
														
							<?php get_sidebar(); ?>
						
						</div>
					
					</div>
					<div class="hidecorner"></div>
				</div>
			</div>

<?php get_sidebar(); ?>

<?php get_footer(); ?>